import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '@/views/backStage/Dashboard/Dashboard.vue'),
                    meta: { title: '个人中心' }
                },
                {
                    path: '/tabs',
                    // component: () => import(/* webpackChunkName: "tabs" */ '@/views/backStage/Tabs/Tabs.vue'),
                    // component: () => import(/* webpackChunkName: "tabs" */ '@/views/backStage/Tabs/demo.vue'),
                    // component: () => import(/* webpackChunkName: "tabs" */ '@/views/backStage/Tabs/jsmind.vue'),
                    // component: () => import(/* webpackChunkName: "tabs" */ '@/views/backStage/Tabs/RelationGraph.vue'),
                    component: () => import(/* webpackChunkName: "tabs" */ '@/views/backStage/Tabs/index.vue'),
                    meta: { title: 'tab选项卡' }
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: () => import(/* webpackChunkName: "upload" */ '../components/page/Upload.vue'),
                    meta: { title: '文件上传' }
                },
            ]
        },
        {
            path: '/graph',
            component: () => import(/* webpackChunkName: "tabs" */ '@/views/graph/demo.vue'),
            meta: { title: 'graph' }
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '/frontDesk',
            component: () => import(/* webpackChunkName: "frontDesk" */ '../views/frontDesk/frontHome/index.vue'),
            meta: { title: '前台页面' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
